<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
    <title>测试</title>
</head>
<body>

<script src="./js/jquery-3.6.0.js"></script>


<script>
    $(function () {
        let id = $.getUrlVar('id');
        $.ajax({
            url: "/es/Alert/upload/"+id,
            success: function (result) {
                let rows = result.data.rows;
                $("#accordion").append("<h1>预警任务共计："+(rows.length)+"条</h1>");
            }
        });
    });

    $.extend({
        getUrlVars: function () {
            let vars = [], hash;
            let hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
            for (let i = 0; i < hashes.length; i++) {
                hash = hashes[i].split('=');
                vars.push(hash[0]);
                vars[hash[0]] = hash[1];
            }
            return vars;
        },
        getUrlVar: function (name) {
            return $.getUrlVars()[name];
        }
    });
</script>
<div id="accordion">


</div>
</body>
</html>
